<?php

namespace app\admin\model\fm;

use think\Model;

/**
 * Banktrans
 */
class Banktrans extends Model
{
    // 表主键
    protected $pk = 'banktransid';
    
    // 表名
    protected $name = 'fm_banktrans';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function typeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\setup\Systypes::class, 'type', 'typeid');
    }

    public function bankactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Bankaccounts::class, 'bankact', 'bankaccountcode');
    }

    public function banktranstypeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Paymentmethods::class, 'banktranstype', 'paymentid');
    }

    public function currcodeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Currencies::class, 'currcode', 'currabrev');
    }
}